/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"DC40A2ED-52E7-452B-8CCD-596A64AE4B19"}
 */
function calcular_debe_haber(oldValue, newValue, event) {
	globals.gtotal_debe = 0
	globals.gtotal_haber = 0
	
	var $cant = databaseManager.getFoundSetCount(foundset)
	for (var i = 1 ; i <= $cant ; i++)
	{
		var $rcd = foundset.getRecord(i)
		globals.gtotal_debe += $rcd.importe_carga_debe
		globals.gtotal_haber += $rcd.importe_carga_haber
	}
	return true
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E67EB679-B13E-45E0-8398-AD4F240E5C8D"}
 */
function onShow(firstShow, event) {
	if (foundset.getSize()!= 0)
	{
		controller.sort("columna asc")
	} 	
}
